﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using System.ComponentModel.DataAnnotations;
using NHibernate.Criterion;

namespace ZDSoft.LMS.Domain
{
    [ActiveRecord("Driver")]
    public class Driver : EntityBase
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Property(NotNull = true, Length = 20)]
        [Required(ErrorMessage = "不能为空")]
        [StringLength(20, ErrorMessage = "不能超过20个字符")]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        /// <summary>
        /// 帐户名
        /// </summary>
        [Property(NotNull = true, Length = 50)]
        [Required(ErrorMessage = "不能为空")]
        [StringLength(20, ErrorMessage = "不能超过50个字符")]
        [Display(Name = "帐号")]
        public string Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Property(NotNull = true, Length = 50)]
        [Required]
        [Display(Name = "密码")]
        public string Password { get; set; }

        /// <summary>
        /// 是否激活，默认应该为true
        /// </summary>
        [Property(NotNull = true)]
        [Required]
        [Display(Name = "激活")]
        public bool IsActive { get; set; }
        /// <summary>
        /// 基本月薪
        /// </summary>
        [Property(Length = 20)]
        [Display(Name = "基本月薪")]
        [Required(ErrorMessage = "不能为空！")]
        public virtual decimal BasicSalary { get; set; }
    }
}
